package com.mt.shop.service.Impl;

import com.mt.shop.domain.User;
import com.mt.shop.mapper.UserDao;
import com.mt.shop.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Transactional
@Service
public class IUserServiceImpl implements IUserService {

    @Autowired
    private UserDao userDao;

    @Override
    public void add(String username, String password) {
        userDao.add(username,password);
    }

    @Override
    public void del(Long userid) {
        userDao.del(userid);
    }

    @Override
    public void upd(User user) {
        userDao.upd(user);
    }

    @Override
    public User getUserById(Long userid) {
        return userDao.getUserById(userid);
    }

    @Override
    public List<User> getAll() {
        return userDao.getAll();
    }
}
